import useCounter from "../hooks/useCounter";

const Counter = () => {
    const { count, increment, decrement } = useCounter();
    return (
        <>
            <div className='alert alert-danger'>当前数值为：{count}</div>
            <button
                className='btn btn-block btn-info'
                onClick={() => increment(2)}
            >
                增加
            </button>
            <button
                className='btn btn-block btn-danger'
                onClick={() => decrement(3)}
            >
                减少
            </button>
        </>
    );
};

export default Counter;
